The present invention relates generally to data cache performance, and more particularly to controlling performance of a data cache in dependence on a performance target. Cache control methods are provided, together with apparatus and computer program products implementing such methods.
A data cache is a component used to store copies of data objects which are also stored in some form of main data storage so that future requests for data can be served faster. The data store of the cache typically uses a faster storage medium (in terms of access latency, throughput, or both) than the main data store. For example, if the main data store is a hard disk drive, the cache may use DRAM (dynamic random-access memory) or non-volatile memory such as NAND flash, 3DXP (3D cross point) or PCM (phase change memory) as its storage medium. A cache may also be located closer than the main data store (in terms of access latency) to the point at which data requests are made in a data processing system, and usually has less-stringent fault tolerance and data redundancy requirements than the main data store.
Data caches can be implemented via hardware or software in a wide range of system architectures, e.g. as CPU (central processing unit) or DSP (digital signal processor) caches, disk caches, web caches, and caches in tiered storage or distributed processing systems such as data centres or multi-server networks. The operating principles are much the same however. An index, or “directory”, is maintained for all cached data objects. The cache directory contains unique identifiers for data objects and address data indicating (logical or physical) addresses for objects in the cache's data store. A cache hit occurs when requested data is found and serviced from the cache, and a cache miss occurs when the requested data is not found in the cache and has to be serviced from the main data store. A cache is typically populated in response to a cache miss (as well as other events in some cases). When a cache contains insufficient space for new data, then previously-cached data is selected for eviction to make room for new data. The data to be evicted is chosen based on a cache eviction policy (also termed “cache replacement policy”), e.g. a least-recently-used (LRU) policy.
Management of storage space in a storage medium of the cache (including capacity utilization bookkeeping, space allocation, reclamation, etc.) is performed by a storage allocator of the cache. Some storage allocators only allow data to be allocated (and updated) out-of-place on the storage medium. For example, a log-structured storage allocator manages the storage medium as a sequentially-written log, whereby new or updated data written to the cache is allocated sequentially to free storage locations. Such allocators offer efficient (tuneable) capacity utilization but require a clean-up process known as “garbage collection”. The garbage collection process selects blocks of storage locations, which typically contain both valid (current) and invalid (deleted or updated) data, in the data store, and relocates the valid data to new storage locations. This frees the storage blocks for future data allocation.